package com.study.tips;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TipsApplication {

    public static void main(String[] args) {
        SpringApplication.run(TipsApplication.class, args);
    }

    // 条件断点
    @Test
    public void conditionBreakPoint() {
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
        }
    }

    // 回到上一步
    @Test
    public void dropFrameDebug() {
        Student student = Student.builder().name("张三").build();
        method1(student);
    }

    private void method1(Student student) {
        System.out.println("method1：" + student);
        method2(student);
    }

    private void method2(Student student) {
        student.setName(student.getName() + student.getName());
        System.out.println("method2：" + student);
    }

    @Data
    @Builder
    @AllArgsConstructor
    public static class Student {
        private String name;
    }

}
